package cn.supermaster.management.web.rest.finance;

import cn.supermaster.management.common.page.TableDataInfo;
import cn.supermaster.management.common.response.WebResponse;
import cn.supermaster.management.finance.domain.FinanceAccount;
import cn.supermaster.management.finance.service.IFinanceAccountService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * All rights Reserved, Designed By www.super-master.cn
 *
 * @ProjectName: supermaster-management
 * @Package: cn.supermaster.management.web.rest.finance
 * @ClassName: FinanceAccountRestController
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2021/2/21 21:36
 * @Version: V1.0
 * @Copyright: 2021 www.super-master.cn Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@RestController
@RequestMapping("/finance/account")
public class FinanceAccountRestController {

    @Autowired
    private IFinanceAccountService financeAccountService;

    @RequiresPermissions("finance:account:list")
    @PostMapping("/list")
    public TableDataInfo queryFinanceAccountListByCondition() {
        return financeAccountService.queryFinanceAccountListByCondition(null);
    }

    @RequiresPermissions("finance:account:add")
    @PostMapping("/add")
    public WebResponse addFinanceAccount(@RequestBody FinanceAccount account) {
        return financeAccountService.addFinanceAccount(account);
    }
}